home *** CD-ROM | disk | FTP | other *** search
/ Inside Indy 1993 / Inside Indy 1993.iso / demos / WorkShop / install.WorkShop < prev    next >
Encoding:
Text File  |  1993-06-23  |  1.7 KB  |  38 lines

  1. #!/bin/csh
  2.  
  3. # Env variable for WorkShop directory
  4. setenv WSDIR /CDROM/demos/WorkShop
  5.  
  6. # Check to see if WorkShop is already on the system
  7. set EXISTS = `$WSDIR/chkinstall WorkShop`
  8. if ($EXISTS == "yes" ) then
  9.     if (`$WSDIR/xconfirm -B "cancel" -b "install" -t "WorkShop appears be installed on your system already." -t "Do you wish to install WorkShop anyway?"` == "cancel") exit
  10.     @ SPACE_USED = `/bin/du -sk /usr/WorkShop | /usr/bin/awk '{print $1}'`
  11. else
  12.     @ SPACE_USED = 0
  13. endif
  14.  
  15. # Check to see if there is enough disk space to install
  16. @ SPACE_REQ   = 30
  17. @ SPACE_AVAIL = `/bin/df -k /usr | /bin/grep /usr | /usr/bin/awk '{print $5}'`
  18. @ SPACE_AVAIL = ($SPACE_AVAIL + $SPACE_USED) / 1024
  19. if ($SPACE_REQ > $SPACE_AVAIL) then
  20.     if (`$WSDIR/xconfirm -B "cancel" -b "install" -t "There is not enough space in /usr to install WorkShop." -t " " -t "Space required: $SPACE_REQ Megabytes." -t "Space available: $SPACE_AVAIL Megabytes." -t " " -t "Do you wish to try to install WorkShop anyway?"` == "cancel") exit
  21. endif
  22.  
  23. # Last Chance to cancel
  24. if (`$WSDIR/xconfirm -B "cancel" -b "install" -t "Installation of WorkShop will take approximately 5 minutes, " -t "and use $SPACE_REQ Megabytes in /usr." -t " " -t "NOTE:  If you have a root passwd, you will need to enter it." -t " " -t "Okay to proceed?"` == "cancel") exit
  25.  
  26. # Install product
  27. /usr/sbin/xwsh -bg royalblue -fg white \
  28.    -geom 80x20+100+100 \
  29.    -title "Installing WorkShop..." \
  30.    -e /bin/csh -c \
  31.    "echo ; \
  32.     echo Installation of this product requires ROOT privileges.; \
  33.     echo If your system has a ROOT password, you must enter it.; \
  34.     echo If you have no ROOT password, you will not be prompted for it.; \
  35.     echo ; \
  36.     su root -c '$WSDIR/inst.root'"
  37.  
  38.